# check root
if [ "$EUID" -ne 0 ]; then
	echo "错误：此脚本必须以 root 用户身份运行" >&2
	exit 1
fi

# network
bash -c "$(wget https://gitee.com/hevey88/install_script/raw/main/dns_single_request.sh -O -)"

# source
bash -c "$(wget https://gitee.com/hevey88/install_script/raw/main/debian_write_source.sh -O -)"

# package
apt install neovim sudo curl git strace fatrace apt-file -y
usermod -aG sudo jacky
apt-file update

# debian_change_console_font to default8x16
bash -c "$(wget https://gitee.com/hevey88/install_script/raw/main/debian_change_console_font.sh -O -)"

# sudo nopasswd
echo "$(id -nu 1000) ALL=(ALL) NOPASSWD:ALL" | tee /etc/sudoers.d/user_nopasswd >/dev/null

# timezone
timedatectl set-timezone Asia/Shanghai

# grub
bash -c "$(curl -fsSL https://gitee.com/hevey88/install_script/raw/main/grub_time.sh)"

# neovim as default_editor
bash -c "$(curl -fsSL https://gitee.com/hevey88/install_script/raw/main/neovim_default_editor.sh)"

# sensible-editor(vipw vigr)
touch ~/.selected_editor
touch /home/"$(id -nu 1000)"/.selected_editor
chown "$(id -nu 1000)":"$(id -nu 1000)" /home/"$(id -nu 1000)"/.selected_editor

# bash -c "$(wget https://gitee.com/hevey88/install_script/raw/main/debian_init_pd.sh -O -)"
